home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / LCLINT2.SPK / lib / h / posix < prev    next >
Text File  |  1996-09-04  |  19KB  |  903 lines

  1. /*
  2. ** posix.h
  3. **
  4. ** This file should be processed with one of the standard libraries
  5. ** (standard.h or strict.h) to produce posix.lcd or posixstrict.lcd.
  6. */
  7.  
  8. /*@-nextlinemacros@*/
  9. /*@+allimponly@*/
  10. /*@+globsimpmodifiesnothing@*/
  11.  
  12. /*
  13.  * LCLint ISO C + POSIX Library
  14.  *
  15.  * $Id: posix.h,v 1.8 1996/08/19 20:05:09 root Exp $
  16.  */
  17.  
  18. /*
  19.  * In 1988, IEEE Std 1003.1-1988, commonly known as "POSIX" or the
  20.  * "IEEE Portable Operating System Interface for Computing Environments"
  21.  * was published as an American National Standard. In 1990, IEEE Std
  22.  * 1003.1-1990 was published as an International Standard. The two
  23.  * standards differ slightly, and where they do, the 1990 International
  24.  * standard was used for this lclint library. The differences are:
  25.  *
  26.  *  1988: cuserid()
  27.  *  1990: -removed- (but still in this lclint library)
  28.  *
  29.  *  1988:     int read (int, void*, unsigned int)
  30.  *  1990: ssize_t read (int, void*, size_t)
  31.  *
  32.  *  1988:     int write (int, const void*, unsigned int)
  33.  *  1990: ssize_t write (int, const void*, size_t)
  34.  *
  35.  * The other differences are in the semantics of functions.
  36.  */
  37.  
  38. /*
  39.  * The reference for the ISO C part of this library was
  40.  * Plauger, Brodie's "Standard C - A Reference", Prentice Hall.
  41.  * The reference for the POSIX part of this library was
  42.  * Donald Lewine's "POSIX Programmer's Guide", O'Reilly.
  43.  * Transcription by Jens Schweikhardt <schweikhardt@rus.uni-stuttgart.de>
  44.  */
  45.  
  46. /*
  47.  * Note that Amendment 1 to ISO C was published in 1995 after POSIX was out.
  48.  * Amendment 1 basically adds support for wide characters and iso 646
  49.  * source character sets. In particular, there are three new headers:
  50.  * <iso646.h>, <wchar.h>, and <wctype.h>
  51.  */
  52.  
  53. /*
  54.  * Each header has annotations in this order:
  55.  *
  56.  *    1) type definitions (if any)
  57.  *    2) constant definitions (if any)
  58.  *    3) structure definitions (if any)
  59.  *    4) function prototypes and externals (if any)
  60.  *
  61.  *    5) type definitions augmented by POSIX (if any)
  62.  *    6) constant definitions augmented by POSIX (if any)
  63.  *    7) structure definitions augmented by POSIX (if any)
  64.  *    8) function prototypes and externals augmented by POSIX (if any)
  65.  *
  66.  * Builtins are mentioned in the header where they appear according to ISO.
  67.  */
  68.  
  69. /*
  70. ** sys/types.h
  71. */
  72.  
  73. typedef /*@integraltype@*/ dev_t;
  74. typedef /*@integraltype@*/ gid_t;
  75. typedef /*@integraltype@*/ ino_t;
  76. typedef /*@integraltype@*/ mode_t;
  77. typedef /*@integraltype@*/ nlink_t;
  78. typedef /*@integraltype@*/ off_t;
  79. typedef /*@integraltype@*/ pid_t;
  80. typedef /*@integraltype@*/ uid_t;
  81.  
  82. /*
  83. ** dirent.h
  84. */
  85.  
  86. typedef /*@abstract@*/ /*@mutable@*/ void *DIR;
  87.  
  88. struct dirent {
  89.   char    d_name[];
  90. };
  91.  
  92.     extern int
  93. closedir (DIR *dirp)
  94.     /*@modifies errno@*/;
  95.  
  96.     extern /*@null@*/ DIR *
  97. opendir (const char *dirname)
  98.     /*@modifies errno@*/;
  99.  
  100.     extern /*@null@*/ struct dirent *
  101. readdir (DIR *dirp)
  102.     /*@modifies errno@*/;
  103.  
  104.     extern void
  105. rewinddir (DIR *dirp)
  106.     /*@*/;
  107.  
  108. /*
  109. ** errno.h
  110. */
  111.  
  112. /*@constant int E2BIG@*/
  113. /*@constant int EACCES@*/
  114. /*@constant int EAGAIN@*/
  115. /*@constant int EBADF@*/
  116. /*@constant int EBUSY@*/
  117. /*@constant int ECHILD@*/
  118. /*@constant int EDEADLK@*/
  119. /*@constant int EEXIST@*/
  120. /*@constant int EFAULT@*/
  121. /*@constant int EFBIG@*/
  122. /*@constant int EINTR@*/
  123. /*@constant int EINVAL@*/
  124. /*@constant int EIO@*/
  125. /*@constant int EISDIR@*/
  126. /*@constant int EMFILE@*/
  127. /*@constant int EMLINK@*/
  128. /*@constant int ENAMETOOLONG@*/
  129. /*@constant int ENFILE@*/
  130. /*@constant int ENODEV@*/
  131. /*@constant int ENOENT@*/
  132. /*@constant int ENOEXEC@*/
  133. /*@constant int ENOLCK@*/
  134. /*@constant int ENOMEM@*/
  135. /*@constant int ENOSPC@*/
  136. /*@constant int ENOSYS@*/
  137. /*@constant int ENOTDIR@*/
  138. /*@constant int ENOTEMPTY@*/
  139. /*@constant int ENOTTY@*/
  140. /*@constant int ENXIO@*/
  141. /*@constant int EPERM@*/
  142. /*@constant int EPIPE@*/
  143. /*@constant int EROFS@*/
  144. /*@constant int ESPIPE@*/
  145. /*@constant int ESRCH@*/
  146. /*@constant int EXDEV@*/
  147.  
  148. /*
  149. ** fcntl.h
  150. */
  151.  
  152. /*@constant int FD_CLOEXEC@*/
  153. /*@constant int F_DUPFD@*/
  154. /*@constant int F_GETFD@*/
  155. /*@constant int F_GETFL@*/
  156. /*@constant int F_GETLK@*/
  157. /*@constant int F_RDLCK@*/
  158. /*@constant int F_SETFD@*/
  159. /*@constant int F_SETFL@*/
  160. /*@constant int F_SETLK@*/
  161. /*@constant int F_SETLKW@*/
  162. /*@constant int F_UNLCK@*/
  163. /*@constant int F_WRLCK@*/
  164. /*@constant int O_ACCMODE@*/
  165. /*@constant int O_APPEND@*/
  166. /*@constant int O_CREAT@*/
  167. /*@constant int O_EXCL@*/
  168. /*@constant int O_NOCTTY@*/
  169. /*@constant int O_NONBLOCK@*/
  170. /*@constant int O_RDONLY@*/
  171. /*@constant int O_RDWR@*/
  172. /*@constant int O_TRUNC@*/
  173. /*@constant int O_WRONLY@*/
  174. /*@constant int SEEK_CUR@*/
  175. /*@constant int SEEK_END@*/
  176. /*@constant int SEEK_SET@*/
  177. /*@constant int S_IRGRP@*/
  178. /*@constant int S_IROTH@*/
  179. /*@constant int S_IUSR@*/
  180. /*@constant int S_IWXG@*/
  181. /*@constant int S_IWXO@*/
  182. /*@constant int S_IWXU@*/
  183. /*@constant int S_ISGID@*/
  184. /*@constant int S_ISUID@*/
  185. /*@constant int S_IWGRP@*/
  186. /*@constant int S_IWOTH@*/
  187. /*@constant int S_IWUSR@*/
  188. /*@constant int S_IXGRP@*/
  189. /*@constant int S_IXOTH@*/
  190. /*@constant int S_IXUSR@*/
  191.  
  192. struct flock {
  193.   short l_type;
  194.   short l_whence;
  195.   off_t l_start;
  196.   off_t l_len;
  197.   pid_t l_pid;
  198. };
  199.  
  200.     extern int
  201. creat (const char *path, mode_t mode)
  202.     /*@modifies errno@*/;
  203.  
  204.     extern int
  205. fcntl (int fd, int cmd, ...)
  206.     /*@modifies errno@*/;
  207.  
  208.     extern int
  209. open (const char *path, int oflag, ...)
  210.     /*@modifies errno@*/;
  211.  
  212. /*
  213. ** grp.h
  214. */
  215.  
  216. struct group {
  217.   char *gr_name;
  218.   gid_t gr_gid;
  219.   char **gr_mem;
  220. };
  221.  
  222.     extern /*@null@*/ struct group *
  223. getgrgid (gid_t gid)
  224.     /*@modifies errno@*/;
  225.  
  226.     extern /*@null@*/ struct group *
  227. getgrnam (const char *nm)
  228.     /*@modifies errno@*/;
  229.  
  230. /*
  231. ** limits.h
  232. */
  233.  
  234. /*@constant long ARG_MAX@*/
  235. /*@constant long CHILD_MAX@*/
  236. /*@constant long LINK_MAX@*/
  237. /*@constant long MAX_CANON@*/
  238. /*@constant long MAX_INPUT@*/
  239. /*@constant long NAME_MAX@*/
  240. /*@constant long NGROUPS_MAX@*/
  241. /*@constant long OPEN_MAX@*/
  242. /*@constant long PIPE_BUF@*/
  243. /*@constant long SSIZE_MAX@*/
  244. /*@constant long STREAM_MAX@*/
  245. /*@constant long TZNAME_MAX@*/
  246. /*@constant long _POSIX_ARG_MAX@*/
  247. /*@constant long _POSIX_CHILD_MAX@*/
  248. /*@constant long _POSIX_LINK_MAX@*/
  249. /*@constant long _POSIX_MAX_CANON@*/
  250. /*@constant long _POSIX_MAX_INPUT@*/
  251. /*@constant long _POSIX_NAME_MAX@*/
  252. /*@constant long _POSIX_NGROUPS_MAX@*/
  253. /*@constant long _POSIX_OPEN_MAX@*/
  254. /*@constant long _POSIX_PATH_MAX@*/
  255. /*@constant long _POSIX_PIPE_BUF@*/
  256. /*@constant long _POSIX_SSIZE@*/
  257. /*@constant long _POSIX_STREAM@*/
  258. /*@constant long _POSIX_TZNAME_MAX@*/
  259.  
  260. /*
  261. ** pwd.h
  262. */
  263.  
  264. struct passwd {
  265.   char *pw_name;
  266.   uid_t pw_uid;
  267.   gid_t pw_gid;
  268.   char *pw_dir;
  269.   char *pw_shell;
  270. } ;
  271.  
  272.     extern /*@null@*/ struct passwd *
  273. getpwnam (const char *n)
  274.     /* @modifies errno@*/;
  275.  
  276.     extern /*@null@*/ struct passwd *
  277. getpwuid (uid_t uid)
  278.     /* @modifies errno@*/;
  279.  
  280. /*
  281. ** setjmp.h
  282. */
  283.  
  284. typedef /*@abstract@*/ /*@mutable@*/ void *sigjmp_buf;
  285.  
  286.     extern /*@mayexit@*/ void
  287. siglongjmp (sigjmp_buf env, int val)
  288.     /*@*/;
  289.  
  290.     extern int
  291. sigsetjmp (/*@out@*/ sigjmp_buf env, int savemask)
  292.     /*@modifies env@*/;
  293.  
  294. /*
  295. ** signal.h
  296. */
  297.  
  298. typedef /*@abstract@*/ sigset_t;
  299.  
  300. /*@constant int SA_NOCLDSTOP@*/
  301. /*@constant int SIG_BLOCK@*/
  302. /*@constant int SIG_SETMASK@*/
  303. /*@constant int SIG_UNBLOCK@*/
  304. /*@constant int SIGALRM@*/
  305. /*@constant int SIGCHLD@*/
  306. /*@constant int SIGCONT@*/
  307. /*@constant int SIGHUP@*/
  308. /*@constant int SIGKILL@*/
  309. /*@constant int SIGPIPE@*/
  310. /*@constant int SIGQUIT@*/
  311. /*@constant int SIGSTOP@*/
  312. /*@constant int SIGTSTP@*/
  313. /*@constant int SIGTTIN@*/
  314. /*@constant int SIGTTOU@*/
  315. /*@constant int SIGUSR1@*/
  316. /*@constant int SIGUSR2@*/
  317.  
  318. struct sigaction {
  319.   void (*sa_handler)();
  320.   sigset_t sa_mask;
  321.   int sa_flags;
  322. } ;
  323.  
  324.     extern /*@mayexit@*/ int
  325. kill (pid_t pid, int sig)
  326.     /*@modifies errno@*/;
  327.  
  328.     extern int
  329. sigaction (int sig, const struct sigaction *act, /*@out@*/ /*@null@*/ struct sigaction *oact)
  330.     /*@modifies *oact, errno, internalState@*/;
  331.  
  332.     extern int
  333. sigaddset (sigset_t *set, int signo)
  334.     /*@modifies *set, errno@*/;
  335.  
  336.     extern int
  337. sigdelset (sigset_t *set, int signo)
  338.     /*@modifies *set, errno@*/;
  339.  
  340.     extern int
  341. sigemptyset (/*@out@*/ sigset_t *set)
  342.     /*@modifies *set, errno@*/;
  343.  
  344.     extern int
  345. sigfillset (/*@out@*/ sigset_t *set)
  346.     /*@modifies *set, errno@*/;
  347.  
  348.     extern int
  349. sigismember (const sigset_t *set, int signo)
  350.     /*@modifies errno@*/;
  351.  
  352.     extern int
  353. sigpending (/*@out@*/ sigset_t *set)
  354.     /*@modifies *set, errno@*/;
  355.  
  356.     extern int
  357. sigprocmask (int how, /*@null@*/ const sigset_t *set, /*@null@*/ /*@out@*/ sigset_t *oset)
  358.     /*@modifies *oset, errno, internalState@*/;
  359.  
  360.     extern int
  361. sigsuspend (const sigset_t *sigmask)
  362.     /*@modifies errno, internalState@*/;
  363.  
  364. /*
  365. ** stdio.h
  366. */
  367.  
  368. /*@constant int L_ctermid@*/
  369. /*@constant int L_cuserid@*/
  370. /*@constant int STREAM_MAX@*/
  371.  
  372.     extern /*@null@*/ /*@dependent@*/ FILE *
  373. fdopen (int fd, const char *type)
  374.     /*@modifies errno, fileSystem@*/;
  375.  
  376.     extern int
  377. fileno (FILE *fp)
  378.     /*@modifies errno@*/;
  379.  
  380. /*
  381. ** sys/stat.h
  382. */
  383.  
  384. /*@constant int S_IRGRP@*/
  385. /*@constant int S_IROTH@*/
  386. /*@constant int S_IUSR@*/
  387. /*@constant int S_IWXG@*/
  388. /*@constant int S_IWXO@*/
  389. /*@constant int S_IWXU@*/
  390. /*@constant int S_ISGID@*/
  391. /*@constant int S_ISUID@*/
  392. /*@constant int S_IWGRP@*/
  393. /*@constant int S_IWOTH@*/
  394. /*@constant int S_IWUSR@*/
  395. /*@constant int S_IXGRP@*/
  396. /*@constant int S_IXOTH@*/
  397. /*@constant int S_IXUSR@*/
  398.  
  399. struct stat {
  400.   mode_t    st_mode;
  401.   ino_t    st_ino;
  402.   dev_t    st_dev;
  403.   nlink_t    st_nlink;
  404.   uid_t    st_uid;
  405.   gid_t    st_gid;
  406.   off_t    st_size;
  407.   time_t    st_st_atime;
  408.   time_t    st_st_mtime;
  409.   time_t    st_st_ctime;
  410. } ;
  411.  
  412. /*
  413. ** POSIX does not require that the S_I* be functions. They're
  414. ** macros virtually everywhere. 
  415. */
  416.  
  417. # ifdef STRICT
  418. /*@notfunction@*/
  419. # define SBOOLINT bool /*@alt int@*/
  420. # else
  421. /*@notfunction@*/
  422. # define SBOOLINT bool 
  423. # endif
  424.  
  425.     extern SBOOLINT
  426. S_ISBLK (/*@sef@*/ mode_t m)
  427.     /*@*/;
  428.  
  429.     extern SBOOLINT
  430. S_ISCHR (/*@sef@*/ mode_t m)
  431.     /*@*/;
  432.  
  433.     extern SBOOLINT
  434. S_ISDIR (/*@sef@*/ mode_t m)
  435.     /*@*/;
  436.  
  437.     extern SBOOLINT
  438. S_ISFIFO (/*@sef@*/ mode_t m)
  439.     /*@*/;
  440.  
  441.     extern SBOOLINT
  442. S_ISREG (/*@sef@*/ mode_t m)
  443.     /*@*/;
  444.  
  445.     extern int
  446. chmod (const char *path, mode_t mode)
  447.     /*@modifies fileSystem, errno@*/;
  448.  
  449.     extern int
  450. fstat (int fd, /*@out@*/ struct stat *buf)
  451.     /*@modifies errno, *buf@*/;
  452.  
  453.     extern int
  454. mkdir (const char *path, mode_t mode)
  455.     /*@modifies fileSystem, errno@*/;
  456.  
  457.     extern int
  458. mkfifo (const char *path, mode_t mode)
  459.     /*@modifies fileSystem, errno@*/;
  460.  
  461.     extern int
  462. stat (const char *path, /*@out@*/ struct stat *buf)
  463.     /*@modifies errno, *buf@*/;
  464.  
  465.     extern int
  466. umask (mode_t cmask)
  467.     /*@modifies internalState@*/;
  468.  
  469. /*
  470. ** sys/times.h
  471. */
  472.  
  473. struct tms {
  474.   clock_t    tms_utime;
  475.   clock_t    tms_stime;
  476.   clock_t    tms_cutime;
  477.   clock_t    tms_cstime;
  478. };
  479.  
  480.     extern clock_t
  481. times (/*@out@*/ struct tms *tp)
  482.     /*@modifies *tp@*/;
  483.  
  484. /*
  485. ** sys/utsname.h
  486. */
  487.  
  488. struct utsname {
  489.   char    sysname[];
  490.   char    nodename[];
  491.   char    release[];
  492.   char    version[];
  493.   char    machine[];
  494. };
  495.  
  496.     extern int
  497. uname (/*@out@*/ struct utsname *name)
  498.      /*@modifies *name, errno@*/ ;
  499.  
  500. /*
  501. ** sys/wait.h
  502. */
  503.  
  504. extern int WEXITSTATUS (int status) /*@*/ ;
  505. extern int WIFEXITED (int status) /*@*/ ;
  506. extern int WIFSIGNALED (int status) /*@*/ ;
  507. extern int WIFSTOPPED (int status) /*@*/ ;
  508. extern int WSTOPSIG (int status) /*@*/ ;
  509. extern int WTERMSIG (int status) /*@*/ ;
  510.  
  511. /*@constant int WUNTRACED@*/
  512.  
  513.     extern pid_t
  514. wait (/*@out@*/ /*@null@*/ int *st)
  515.     /*@modifies *st, errno@*/;
  516.  
  517.     extern pid_t
  518. waitpid (pid_t pid, /*@out@*/ int *st, int opt)
  519.     /*@modifies *st, errno@*/;
  520.  
  521. /*
  522. ** termios.h
  523. */
  524.  
  525. typedef unsigned char /*@alt unsigned short@*/ cc_t;
  526. typedef unsigned long /*@alt long@*/ speed_t;
  527. typedef unsigned long /*@alt long@*/ tcflag_t;
  528.  
  529. /*@constant int B0@*/
  530. /*@constant int B50@*/
  531. /*@constant int B75@*/
  532. /*@constant int B110@*/
  533. /*@constant int B134@*/
  534. /*@constant int B150@*/
  535. /*@constant int B200@*/
  536. /*@constant int B300@*/
  537. /*@constant int B600@*/
  538. /*@constant int B1200@*/
  539. /*@constant int B1800@*/
  540. /*@constant int B2400@*/
  541. /*@constant int B4800@*/
  542. /*@constant int B9600@*/
  543. /*@constant int B19200@*/
  544. /*@constant int B38400@*/
  545. /*@constant int BRKINT@*/
  546. /*@constant int CLOCAL@*/
  547. /*@constant int CREAD@*/
  548. /*@constant int CS5@*/
  549. /*@constant int CS6@*/
  550. /*@constant int CS7@*/
  551. /*@constant int CS8@*/
  552. /*@constant int CSIZE@*/
  553. /*@constant int CSTOPB@*/
  554. /*@constant int ECHO@*/
  555. /*@constant int ECHOE@*/
  556. /*@constant int ECHOK@*/
  557. /*@constant int ECHONL@*/
  558. /*@constant int HUPCL@*/
  559. /*@constant int ICANON@*/
  560. /*@constant int ICRNL@*/
  561. /*@constant int IEXTEN@*/
  562. /*@constant int IGNBRK@*/
  563. /*@constant int IGNCR@*/
  564. /*@constant int IGNPAR@*/
  565. /*@constant int IGNLCR@*/
  566. /*@constant int INPCK@*/
  567. /*@constant int ISIG@*/
  568. /*@constant int ISTRIP@*/
  569. /*@constant int IXOFF@*/
  570. /*@constant int IXON@*/
  571. /*@constant int NCCS@*/
  572. /*@constant int NOFLSH@*/
  573. /*@constant int OPOST@*/
  574. /*@constant int PARENB@*/
  575. /*@constant int PARMRK@*/
  576. /*@constant int PARODD@*/
  577. /*@constant int TCIFLUSH@*/
  578. /*@constant int TCIOFF@*/
  579. /*@constant int TCIOFLUSH@*/
  580. /*@constant int TCION@*/
  581. /*@constant int TCOFLUSH@*/
  582. /*@constant int TCSADRAIN@*/
  583. /*@constant int TCSAFLUSH@*/
  584. /*@constant int TCSANOW@*/
  585. /*@constant int TOSTOP@*/
  586. /*@constant int VEOF@*/
  587. /*@constant int VEOL@*/
  588. /*@constant int VERASE@*/
  589. /*@constant int VINTR@*/
  590. /*@constant int VKILL@*/
  591. /*@constant int VMIN@*/
  592. /*@constant int VQUIT@*/
  593. /*@constant int VSTART@*/
  594. /*@constant int VSTOP@*/
  595. /*@constant int VSUSP@*/
  596. /*@constant int VTIME@*/
  597.  
  598. struct termios {
  599.   tcflag_t    c_iflag;
  600.   tcflag_t    c_oflag;
  601.   tcflag_t    c_cflag;
  602.   tcflag_t    c_lflag;
  603.   cc_t        c_cc;
  604. } ;
  605.  
  606.     extern speed_t
  607. cfgetispeed (const struct termios *p)
  608.     /*@*/;
  609.  
  610.     extern speed_t
  611. cfgetospeed (const struct termios *p)
  612.     /*@*/;
  613.  
  614.     extern int
  615. cfsetispeed (struct termios *p)
  616.     /*@modifies *p@*/;
  617.  
  618.     extern int
  619. cfsetospeed (struct termios *p)
  620.     /*@modifies *p@*/;
  621.  
  622.     extern int
  623. tcdrain (int fd)
  624.     /*@modifies errno@*/;
  625.  
  626.     extern int
  627. tcflow (int fd, int action)
  628.     /*@modifies errno@*/;
  629.  
  630.     extern int
  631. tcflush (int fd, int qs)
  632.     /*@modifies errno@*/;
  633.  
  634.     extern int
  635. tcgetattr (int fd, /*@out@*/ struct termios *p)
  636.     /*@modifies errno, *p@*/;
  637.  
  638.     extern int
  639. tcsendbreak (int fd, int d)
  640.     /*@modifies errno@*/;
  641.  
  642.     extern int
  643. tcsetattr (int fd, int opt, const struct termios *p)
  644.     /*@modifies errno@*/;
  645.  
  646. /*
  647. ** time.h
  648. */
  649.  
  650. /* Environ must be known before it can be used in `globals' clauses. */
  651.  
  652. /*@unchecked@*/ extern char **environ;
  653.  
  654. /*@constant int CLK_TCK@*/
  655.  
  656.     extern void
  657. tzset (void)
  658.     /*@globals environ@*/ /*@modifies internalState@*/;
  659.  
  660. /*
  661. ** unistd.h
  662. */
  663.  
  664. /*@constant int F_OK@*/
  665. /*@constant int R_OK@*/
  666. /*@constant int SEEK_CUR@*/
  667. /*@constant int SEEK_END@*/
  668. /*@constant int SEEK_SET@*/
  669. /*@constant int STDERR_FILENO@*/
  670. /*@constant int STDIN_FILENO@*/
  671. /*@constant int STDOUT_FILENO@*/
  672. /*@constant int W_OK@*/
  673. /*@constant int X_OK@*/
  674. /*@constant int _PC_CHOWN_RESTRUCTED@*/
  675. /*@constant int _PC_MAX_CANON@*/
  676. /*@constant int _PC_MAX_INPUT@*/
  677. /*@constant int _PC_NAME_MAX@*/
  678. /*@constant int _PC_NO_TRUNC@*/
  679. /*@constant int _PC_PATH_MAX@*/
  680. /*@constant int _PC_PIPE_BUF@*/
  681. /*@constant int _PC_VDISABLE@*/
  682. /*@constant int _POSIX_CHOWN_RESTRICTED@*/
  683. /*@constant int _POSIX_JOB_CONTROL@*/
  684. /*@constant int _POSIX_NO_TRUNC@*/
  685. /*@constant int _POSIX_SAVED_IDS@*/
  686. /*@constant int _POSIX_VDISABLE@*/
  687. /*@constant int _POSIX_VERSION@*/
  688. /*@constant int _SC_ARG_MAX@*/
  689. /*@constant int _SC_CHILD_MAX@*/
  690. /*@constant int _SC_CLK_TCK@*/
  691. /*@constant int _SC_JOB_CONTROL@*/
  692. /*@constant int _SC_NGROUPS_MAX@*/
  693. /*@constant int _SC_OPEN_MAX@*/
  694. /*@constant int _SC_SAVED_IDS@*/
  695. /*@constant int _SC_STREAM_MAX@*/
  696. /*@constant int _SC_TZNAME_MAX@*/
  697. /*@constant int _SC_VERSION@*/
  698.  
  699.     extern /*@exits@*/ void
  700. _exit (int status)
  701.     /*@*/;
  702.  
  703.     extern int
  704. access (const char *path, int mode)
  705.     /*@modifies errno@*/;
  706.  
  707.     extern unsigned int
  708. alarm (unsigned int)
  709.     /*@modifies internalState@*/;
  710.  
  711.     extern int
  712. chdir (const char *path)
  713.     /*@modifies errno@*/;
  714.  
  715.     extern int
  716. chown (const char *path, uid_t owner, gid_t group)
  717.     /*@modifies fileSystem, errno@*/;
  718.  
  719.     extern int
  720. close (int fd)
  721.     /*@modifies fileSystem, errno, internalState@*/;
  722.     /* state: record locks are unlocked */
  723.  
  724.     extern char *
  725. ctermid (/*@returned@*/ /*@out@*/ /*@null@*/ char *s)
  726.     /*@modifies *s, internalState@*/;
  727.  
  728.     /* cuserid is in the 1988 version of POSIX but removed in 1990 */
  729.     extern char *
  730. cuserid (/*@null@*/ /*@out@*/ char *s)
  731.     /*@modifies *s@*/;
  732.  
  733.     extern int
  734. dup2 (int fd, int fd2)
  735.     /*@modifies errno, fileSystem@*/;
  736.  
  737.     extern int
  738. dup (int fd)
  739.     /*@modifies errno, fileSystem@*/;
  740.  
  741.     extern /*@mayexit@*/ int
  742. execl (const char *path, const char *arg, ...)
  743.     /*@modifies errno@*/;
  744.  
  745.     extern /*@mayexit@*/ int
  746. execle (const char *file, const char *arg, ...)
  747.     /*@modifies errno@*/;
  748.  
  749.     extern /*@mayexit@*/ int
  750. execlp (const char *file, const char *arg, ...)
  751.     /*@modifies errno@*/;
  752.  
  753.     extern /*@mayexit@*/ int
  754. execv (const char *path, char *const argv[])
  755.     /*@modifies errno@*/;
  756.  
  757.     extern /*@mayexit@*/ int
  758. execve (const char *path, char *const argv[], char *const *envp)
  759.     /*@modifies errno@*/;
  760.  
  761.     extern /*@mayexit@*/ int
  762. execvp (const char *file, char *const argv[])
  763.     /*@modifies errno@*/;
  764.  
  765.     extern pid_t
  766. fork (void)
  767.     /*@modifies fileSystem, errno@*/;
  768.  
  769.     extern long
  770. fpathconf (int fd, int name)
  771.     /*@modifies errno@*/;
  772.  
  773.     extern char *
  774. getcwd (/*@returned@*/ /*@out@*/ char *buf, size_t size)
  775.     /*@modifies errno, *buf@*/;
  776.  
  777.     extern gid_t
  778. getegid (void)
  779.     /*@*/;
  780.  
  781.     extern uid_t
  782. geteuid (void)
  783.     /*@*/;
  784.  
  785.     extern gid_t
  786. getgid (void)
  787.     /*@*/;
  788.  
  789.     extern int
  790. getgroups (int gs, /*@out@*/ gid_t gl[])
  791.     /*@modifies errno, gl[]@*/;
  792.  
  793.     extern /*@observer@*/ char *
  794. getlogin (void)
  795.     /*@*/;
  796.  
  797.     extern pid_t
  798. getpgrp (void)
  799.     /*@*/;
  800.  
  801.     extern pid_t
  802. getpid (void)
  803.     /*@*/;
  804.  
  805.     extern pid_t
  806. getppid (void)
  807.     /*@*/;
  808.  
  809.     extern uid_t
  810. getuid (void)
  811.     /*@*/;
  812.  
  813.     extern int
  814. isatty (int fd)
  815.     /*@*/;
  816.  
  817.     extern int
  818. link (const char *o, const char *n)
  819.     /*@modifies errno, fileSystem@*/;
  820.  
  821.     extern off_t
  822. lseek (int fd, off_t offset, int whence)
  823.     /*@modifies errno@*/;
  824.  
  825.     extern long
  826. pathconf (const char *path, int name)
  827.     /*@modifies errno@*/;
  828.  
  829.     extern int
  830. pause (void)
  831.     /*@modifies errno@*/;
  832.  
  833.     extern int
  834. pipe (int fd[])
  835.     /*@modifies errno@*/;
  836.  
  837.     extern ssize_t
  838. read (int fd, /*@out@*/ void *buf, size_t nbyte)
  839.     /*@modifies errno, *buf@*/;
  840.  
  841.     extern int
  842. rmdir (const char *path)
  843.     /*@modifies fileSystem, errno@*/;
  844.  
  845.     extern int
  846. setgid (gid_t gid)
  847.     /*@modifies errno, internalState@*/;
  848.  
  849.     extern int
  850. setpgid (pid_t pid, pid_t pgid)
  851.     /*@modifies errno, internalState@*/;
  852.  
  853.     extern pid_t
  854. setsid (void)
  855.     /*@*/;
  856.  
  857.     extern int
  858. setuid (uid_t uid)
  859.     /*@modifies errno, internalState@*/;
  860.  
  861.     extern unsigned int
  862. sleep (unsigned int sec)
  863.     /*@*/;
  864.  
  865.     extern long
  866. sysconf (int name)
  867.     /*@modifies errno@*/;
  868.  
  869.     extern pid_t
  870. tcgetpgrp (int fd)
  871.     /*@modifies errno@*/;
  872.  
  873.     extern int
  874. tcsetpgrp (int fd, pid_t pgrpid)
  875.     /*@modifies errno, internalState@*/;
  876.  
  877.     /* Q: observer ok? */
  878.     extern /*@null@*/ /*@observer@*/ char *
  879. ttyname (int fd)
  880.     /*@modifies errno@*/;
  881.  
  882.     extern int
  883. unlink (const char *path)
  884.     /*@modifies fileSystem, errno@*/;
  885.  
  886.     extern ssize_t
  887. write (int fd, const void *buf, size_t nbyte)
  888.     /*@modifies errno@*/;
  889.  
  890. /*
  891. ** utime.h
  892. */
  893.  
  894. struct utimbuf {
  895.   time_t    actime;
  896.   time_t    modtime;
  897. } ;
  898.  
  899.     extern int
  900. utime (const char *path, /*@null@*/ const struct utimbuf *times)
  901.     /*@modifies fileSystem, errno@*/;
  902.  
  903.